<template>
<the-header />
<span class="hamburger" @click="changeShowSider" v-show="$route.name !== 'Login'"></span>
<transition mode="out-in" name="move">
  <the-sider v-if="showSider" @changeShowSider="changeShowSider" />
</transition>
<transition mode="out-in" name="fade">
  <the-shade v-if="showSider" @changeShowSider="changeShowSider" />
</transition>
<router-view />
</template>

<script>
import TheHeader from '@/components/TheHeader'
import TheSider from '@/components/TheSider'
import TheShade from '@/components/TheShade'
export default {
  components: {
    TheHeader,
    TheSider,
    TheShade
  },
  data() {
    return {
      showSider: false
    }
  },
  methods: {
    changeShowSider() {
      this.showSider = !this.showSider
    }
  }
}
</script>

<style lang="scss" scoped>
.hamburger {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 20px;
  height: 20px;
  background-image: url('./assets/images/hamburger.png');
  background-size: 100%;
}

.move-enter-active,
.move-leave-active {
  transition: all .4s ease;
}

.move-enter-from,
.move-leave-to {
  transform: translateX(-100%);
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>
